﻿using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace Simple.EntityFramewokCore
{
    public static class SimpleEntityFramewokCoreExtension
    {
        public static IServiceCollection AddEntityFramewokCore<IDbContext>(this IServiceCollection services,
            Action<DbContextOptionsBuilder>? options = null,
            ServiceLifetime lifetime = ServiceLifetime.Singleton)
            where IDbContext : MasterDbContext<IDbContext>
        {
            services.AddDbContext<IDbContext>(options, lifetime);
            return services;

        }

    }
}
